#include "dummyelement.h"
#include <QGraphicsSvgItem>
#include <QGraphicsScene>
#include "qgraphicspushbutton.h"
using namespace Touche;

quint32 DummyElement::counter = 0;

DummyElement::DummyElement()
{
    Element::id = counter++;
}

Element::Options DummyElement::flags()
{
    return Element::IS_EDITABLE;
}

QGraphicsItem * DummyElement::item(QGraphicsItem  *parentItem) const
{
    return new QGraphicsSvgItem(":/gfx/svg/touche_logo.svg", parentItem);
}

void DummyElement::edit(QGraphicsScene *scene)
{
    QGraphicsPushButton *button = new QGraphicsPushButton(":/gfx/svg/lgpl-v3-logo.svg");
    scene->addItem(button);
    connect(button, SIGNAL(clicked()), this, SIGNAL(edition_finished()));
    return;
}
